/**
 * Problem 1
 * 05 October 2001
 * 
 * If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
 * 
 * Find the sum of all the multiples of 3 or 5 below 1000.
 * 
 */
package com.asharism.projectEuler.problem001;

/**
 * @author Hitec
 *
 */
public class HelloWorld {

	private static final int MAX_NUMBER = 1000; 
	
	public static void main(String[] args) {
		Stopwatch stopwatch = new Stopwatch();
		
		stopwatch.start();
		int sum = 0;
		for(int index = 1; index < MAX_NUMBER; index++) {
			if(isDivisibleBy3Or5(index))
				sum += index;
		}
		stopwatch.stop();
		
		System.out.println(sum);
		System.out.println("Excution time: " + stopwatch.getElapsedTime() + "ms.");
	}

	private static boolean isDivisibleBy3Or5(int number) {
		return (0 == number % 3) || (0 == number % 5); 
	}

}
